package com.wenhuang.chatgptopen.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wenhuang.chatgptopen.mapper.UserMapper;
import com.wenhuang.chatgptopen.pojo.User;
import com.wenhuang.chatgptopen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 *@Time：2023/5/20
 *@Author：Jelly
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Integer addUser(User user) {
        return userMapper.addUser(user);
    }


    @Override
    public User getUserByEmailAndPwd(User user) {
        return userMapper.getUserByEmailAndPwd(user);
    }

    @Override
    public User verifyEmail(User user) {
        return userMapper.verifyEmail(user);
    }

    @Override
    public String getAvatar(User user) {
        return userMapper.getAvatar(user);
    }

    @Override
    public Integer changeAvatar(String path, Integer id) {
        return userMapper.changeAvatar(path,id);
    }

    @Override
    public Integer changeUsername(String username, Integer id) {
        return userMapper.changeUsername(username,id);
    }

    @Override
    public Integer changePassword(String password, Integer id) {
        return userMapper.changePassword(password,id);
    }

    @Override
    public String selectUsername(String username) {
        return userMapper.selectUsername(username);
    }

    @Override
    public User getUserById(User user) {
        return userMapper.getUserById(user);
    }

    @Override
    public Integer changFans(User user) {
        return userMapper.changFans(user);
    }

    @Override
    public Integer deleteFans(User user) {
        return userMapper.deleteFans(user);
    }

    @Override
    public List<User> searchUser(User user) {
        return userMapper.searchUser(user);
    }
}
